#ifndef __DIALOG_TRANSACTION_STATE_H__
#define __DIALOG_TRANSACTION_STATE_H__
#include "xtransactionstate.h"
#include "DelayQueue.hh"
class DelayQueueEntry;
class XSIPResponse;

class XSIPDialogClientTransactionState : public XSIPTransactionState {
public:
	XSIPDialogClientTransactionState(void* transaction);
	virtual ~XSIPDialogClientTransactionState();
	virtual int touch();
	virtual void complete();
	virtual void timeout();
private:
	DelayQueueEntry *m_retran;
	DelayQueueEntry *m_timeout;
	int m_ts;
	XSIPResponse* m_response;
};

class XSIPDialogServerTransactionState : public XSIPTransactionState {
public:
	XSIPDialogServerTransactionState(void* transaction);
	virtual ~XSIPDialogServerTransactionState();
	virtual int touch();
	virtual void complete();
	virtual void timeout();
private:
	DelayQueueEntry *m_retran;
	DelayQueueEntry *m_timeout;
	int m_ts;
};

class RetranResponse : public DelayQueueEntry {
public:
	RetranResponse(XSIPTransactionState* state, DelayInterval to);
	virtual ~RetranResponse();
	virtual void handleTimeout();
private:
	XSIPTransactionState *m_state;
};

#endif